<!-- @format -->

<template>
  <div>
    <!-- 1. .enter修饰符：监测回车键 -->
    <input
      type="text"
      @keyup.enter="doSearch" />

    <!-- 2. .esc修饰符：监测取消键 -->
    <input
      type="text"
      @keyup.esc="doEsc" />
  </div>
</template>

<script>
  export default {
    methods: {
      doSearch() {
        console.log('doSearch')
      },
      doEsc() {
        console.log('doEsc')
      }
    }
  }
</script>

<style></style>
